package com.software.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.software.bean.CategoryBean;
import org.apache.ibatis.annotations.MapKey;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author wyj
 * @since 2024-03-07
 */
public interface CategoryMapper extends BaseMapper<CategoryBean> {

    List<CategoryBean> queryMidIconInHomePage();

    IPage<CategoryBean> queryMidIconPagination(Page<CategoryBean> page);

    Integer queryIconName(String name);


//     List<Map<String , Object>> queryAllCategory();

    // 添加二级分类 mapper 查一级分类的id 和name
    @MapKey("name")
    List<Map<String , Integer>> queryAllFirstCategory();

    @MapKey("key")
    List<Map<String, Object>> getCategoryByFront();

    @MapKey("name")
    List<Map<String, Integer>> selectCategoryLevelOne();
}
